﻿@model CMS.UI.Models.SettingsListModel
@for (int i = 0; i < Model.list.Count; i++)
{
    <div>
        <div class="inputContainer">
        <input type="hidden" name="@String.Format("SettingsValues[{0}].SettingsValueID", Model.startCountAt + i)" value="@Model.list[i].SettingsValueID"  />
        <label for="@String.Format("SettingsValues_{0}__SV_Value", Model.startCountAt + i)">@Model.list[i].Settings.SE_Variable</label>
        @switch (Model.list[i].Settings.SE_Type)
        {
            case (int)CMS.BL.SettingsType.String:
            <input id="@String.Format("SettingsValues_{0}__SV_Value", Model.startCountAt + i)"
             name="@String.Format("SettingsValues[{0}].SV_Value", Model.startCountAt + i)" type="text" value="@Model.list[i].SV_Value" />
             break;
            case (int)CMS.BL.SettingsType.Bool:
            @Html.CheckBox(String.Format("SettingsValues[{0}].SV_Value", Model.startCountAt + i), Model.list[i].SV_Value.AsBool())
            break;
            case (int)CMS.BL.SettingsType.Enum:
            <select id="@String.Format("SettingsValues_{0}__SV_Value", Model.startCountAt + i)" data-savedValue="@Model.list[i].SV_Value" data-selectID="@Model.list[i].SV_SettingsID" name="@String.Format("SettingsValues[{0}].SV_Value", Model.startCountAt + i)">
            </select>
            break;
        }
        </div>
        <input type="hidden" name="@String.Format("SettingsValues[{0}].SV_SettingsID", Model.startCountAt + i)" value="@Model.list[i].SV_SettingsID" />
        <span class="description">@Model.list[i].Settings.SE_Description</span>
    </div>
}